Skip to main content

Getting Validators

getValidators​

Returns the validators supported on a given Blockchain, and optionally with a given Scheme.

Usage​

import { getValidators } from '@chronicleprotocol/pull-oracle';

const validators = await getValidators({ blockchain });

Returns​

Returns a promise that provides the Blockchain, Scheme, and a Validators array of addresses.

interface ValidatorData {
blockchain: Blockchain;
scheme: Scheme;
validators: Address[];
}

Example​

{
blockchain: "ETH",
scheme: "ECDSA",
validators: [
"0xabc123...",
"0xabc123...",
"0xabc123...",
...
]
}

Parameters​

blockchain​

A blockhain identifier indicating on which chain the validators are going to be used.

scheme​

  • Optional
  • Type: Scheme
  • Default: ECDSA

The encryption scheme used for price messages of these validators

Errors​

In the event of an error, the return object will be an APIResponseError.

Example​

{
error: true,
message: `VADER blockchain not supported`,
data: {
scheme: "ECDSA",
blockchain: "VADER"
},
code: APIErrorCode.BLOCKCHAIN_NOT_SUPPORTED
}